package demo4;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 何华树
 * Date: 2024-09-02
 * Time: 12:40
 */
public class Duck extends Animal implements IRunning,ISwimming,Ifly{
    public Duck(String name, int age) {
        super(name, age);
    }

    public void eat() {
        System.out.println("吃鸭粮...");
    }

    @Override
    public void run() {
        System.out.println(this.name+" 在跑");
    }

    @Override
    public void swim() {
        System.out.println(this.name+" 在游泳。");
    }

    @Override
    public void fly() {
        System.out.println(this.name+" 在飞.");
    }
}
